<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.12/vue.js"></script>
</head>
<body>
<!--阻止事件冒泡要从目标元素开始阻止-->
<!--阻止事件捕获要从最外层元素开始阻止-->
<!--点时间可以连着用，例如：.enter.once-->
<!--常用的点事件-->
<!--.stop .prevent .capture .enter .self -->
<div id="app">
    <div @click="outerClick">
        Outter
        <div @click="innerClick">
            inner
            <div @click.stop="contentClick">
                content
            </div>
        </div>
    </div>
<!--    阻止鼠标右键默认行为-->
    <button @contextmenu.prevent="fn">阻止右键</button>
</div>
<script>
    Vue.config.productionTip = false
    const vm = new Vue({
        el: '#app',
        data() {
            return {

            }
        },
        methods:{
            outerClick(){
                console.log('outerClick')
            },
            innerClick(){
                console.log('innerClick')
            },
            contentClick(){
                console.log('contentClick')
            },
            fn(){
                console.log('右键触发了.....')
            }
        }
    })
</script>
</body>
</html>